package com.payment.ktb.activity.main3;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.payment.ktb.R;
import com.payment.ktb.activity.BaseActivity;
import com.payment.ktb.application.MyApplication;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by syd on 2016/6/21.
 */
public class OrderDetailActivity extends BaseActivity {


    String status = "";
    int statuscode = 0;
    String orderno = "";
    String bankname = "";
    String amount = "";
    String bankno = "";
    String time = "";


    @BindView(R.id.tv_orderdetail_status)
    TextView tv_orderdetail_status;
    @BindView(R.id.tv_orderdetail_orderno)
    TextView tv_orderdetail_orderno;
    @BindView(R.id.tv_orderdetail_bankname)
    TextView tv_orderdetail_bankname;
    @BindView(R.id.tv_orderdetail_amount)
    TextView tv_orderdetail_amount;
    @BindView(R.id.tv_orderdetail_bankno)
    TextView tv_orderdetail_bankno;
    @BindView(R.id.tv_orderdetail_time)
    TextView tv_orderdetail_time;





    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_orderdetail);
        ButterKnife.bind(this);
        initTitle("订单详情");
        hideTitleBack();
        initData();



    }


    /**
     *
     */
    private void initData() {

        statuscode = getIntent().getIntExtra("statuscode",0);
        status = getIntent().getStringExtra("status");
        orderno = getIntent().getStringExtra("orderno");
        bankname = getIntent().getStringExtra("bankname");
        amount = getIntent().getStringExtra("amount");
        bankno = getIntent().getStringExtra("bankno");
        time = getIntent().getStringExtra("time");

        if (statuscode == 20) {
            tv_orderdetail_status.setTextColor(MyApplication.getContext().getResources().getColor(R.color.green));
        } else if (statuscode == 21) {
            tv_orderdetail_status.setTextColor(MyApplication.getContext().getResources().getColor(R.color.red));
        } else {
            tv_orderdetail_status.setTextColor(MyApplication.getContext().getResources().getColor(R.color.text464646));
        }
        tv_orderdetail_status.setText(status);
        tv_orderdetail_orderno.setText(orderno);
        tv_orderdetail_bankname.setText(bankname);
        tv_orderdetail_amount.setText(amount);
        tv_orderdetail_bankno.setText(bankno);
        tv_orderdetail_time.setText(time);


    }


    @OnClick(R.id.btn_orderdetail_confirm)
    public void clickEvent(View view) {

        finish();

    }

}
